import {createStore, applyMiddleware} from 'redux';
import thunk from 'redux-thunk'
import {composeWithDevTools} from 'redux-devtools-extension'
import {counter} from './reducers';

// 生成一store对象
const store = createStore(
    counter,
    // applyMiddleware(thunk) // 应用上异步中间件
    composeWithDevTools(applyMiddleware(thunk)) // 应用上异步中间件
); // 内部会第一次调用reducer函数的到初始state，然后在渲染组件标签


export default store;

